﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// abstract OsobaBankovniRacun typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class OsobaBankovniRacunDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<OsobaBankovniRacunDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.OsobaBankovniRacun _currentOsobaBankovniRacun = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxOsobaBankovniRacunDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxOsobaBankovniRacunErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxOsobaBankovniRacunBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the ID property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the BrojRacuna property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxBrojRacunaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the ModelZaIsplatuPlace property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxModelZaIsplatuPlaceDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the PozivNaBrojZaIsplatuPlace property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxPozivNaBrojZaIsplatuPlaceDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDOsoba property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDOsobaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DatumOd property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDatumOdDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DatumDo property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDatumDoDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the PrimateljNaziv property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxPrimateljNazivDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the PrimateljSjediste property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxPrimateljSjedisteDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the BrojRacuna2 property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxBrojRacuna2DataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.Osoba> _IDOsobaList;
		
		/// <summary> 
		/// The list of selectable Osoba
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.Osoba> IDOsobaList
		{
			get {return this._IDOsobaList;}
			set 
			{
				this._IDOsobaList = value;
				this.uxIDOsobaDataGridViewColumn.DataSource = null;
				this.uxIDOsobaDataGridViewColumn.DataSource = this._IDOsobaList;
			}
		}
		
		private bool _allowNewItemInIDOsobaList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of Osoba
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDOsobaList
		{
			get { return _allowNewItemInIDOsobaList;}
			set
			{
				this._allowNewItemInIDOsobaList = value;
				this.uxIDOsobaDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.OsobaBankovniRacun> _OsobaBankovniRacunList;
				
		/// <summary> 
		/// The list of OsobaBankovniRacun to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.OsobaBankovniRacun> OsobaBankovniRacunList
		{
			get {return this._OsobaBankovniRacunList;}
			set
			{
				this._OsobaBankovniRacunList = value;
				this.uxOsobaBankovniRacunBindingSource.DataSource = null;
				this.uxOsobaBankovniRacunBindingSource.DataSource = value;
				this.uxOsobaBankovniRacunDataGridView.DataSource = null;
				this.uxOsobaBankovniRacunDataGridView.DataSource = this.uxOsobaBankovniRacunBindingSource;				
				//this.uxOsobaBankovniRacunBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxOsobaBankovniRacunBindingSource_ListChanged);
				this.uxOsobaBankovniRacunBindingSource.CurrentItemChanged += new System.EventHandler(OnOsobaBankovniRacunBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnOsobaBankovniRacunBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentOsobaBankovniRacun = uxOsobaBankovniRacunBindingSource.Current as Entities.OsobaBankovniRacun;
			
			if (_currentOsobaBankovniRacun != null)
			{
				_currentOsobaBankovniRacun.Validate();
			}
			//_OsobaBankovniRacun.Validate();
			OnCurrentEntityChanged();
		}

		//void uxOsobaBankovniRacunBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.OsobaBankovniRacun"/> instance.
		/// </summary>
		public Entities.OsobaBankovniRacun SelectedOsobaBankovniRacun
		{
			get {return this._currentOsobaBankovniRacun;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxOsobaBankovniRacunDataGridView.VirtualMode;}
			set
			{
				this.uxOsobaBankovniRacunDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxOsobaBankovniRacunDataGridView.AllowUserToAddRows;}
			set {this.uxOsobaBankovniRacunDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxOsobaBankovniRacunDataGridView.AllowUserToDeleteRows;}
			set {this.uxOsobaBankovniRacunDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxOsobaBankovniRacunDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxOsobaBankovniRacunDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="OsobaBankovniRacunDataGridViewBase"/> class.
		/// </summary>
		public OsobaBankovniRacunDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxOsobaBankovniRacunDataGridView = new System.Windows.Forms.DataGridView();
			this.uxOsobaBankovniRacunBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxOsobaBankovniRacunErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxIDDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxBrojRacunaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxModelZaIsplatuPlaceDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxPozivNaBrojZaIsplatuPlaceDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDOsobaDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxDatumOdDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDatumDoDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxPrimateljNazivDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxPrimateljSjedisteDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxBrojRacuna2DataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			//this.uxIDOsobaBindingSource = new OsobaBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDOsobaBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaBankovniRacunDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaBankovniRacunBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaBankovniRacunErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxOsobaBankovniRacunErrorProvider
			// 
			this.uxOsobaBankovniRacunErrorProvider.ContainerControl = this;
			this.uxOsobaBankovniRacunErrorProvider.DataSource = this.uxOsobaBankovniRacunBindingSource;						
			// 
			// uxOsobaBankovniRacunDataGridView
			// 
			this.uxOsobaBankovniRacunDataGridView.AutoGenerateColumns = false;
			this.uxOsobaBankovniRacunDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxOsobaBankovniRacunDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxIDDataGridViewColumn,
		this.uxBrojRacunaDataGridViewColumn,
		this.uxModelZaIsplatuPlaceDataGridViewColumn,
		this.uxPozivNaBrojZaIsplatuPlaceDataGridViewColumn,
		this.uxIDOsobaDataGridViewColumn,
		this.uxDatumOdDataGridViewColumn,
		this.uxDatumDoDataGridViewColumn,
		this.uxPrimateljNazivDataGridViewColumn,
		this.uxPrimateljSjedisteDataGridViewColumn,
		this.uxBrojRacuna2DataGridViewColumn			});
			this.uxOsobaBankovniRacunDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxOsobaBankovniRacunDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxOsobaBankovniRacunDataGridView.Name = "uxOsobaBankovniRacunDataGridView";
			this.uxOsobaBankovniRacunDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxOsobaBankovniRacunDataGridView.TabIndex = 0;	
			this.uxOsobaBankovniRacunDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxOsobaBankovniRacunDataGridView.EnableHeadersVisualStyles = false;
			this.uxOsobaBankovniRacunDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnOsobaBankovniRacunDataGridViewDataError);
			this.uxOsobaBankovniRacunDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnOsobaBankovniRacunDataGridViewCellValueNeeded);
			this.uxOsobaBankovniRacunDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnOsobaBankovniRacunDataGridViewCellValuePushed);
			
			//
			// uxIDDataGridViewColumn
			//
			this.uxIDDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDataGridViewColumn.DataPropertyName = "ID";
			this.uxIDDataGridViewColumn.HeaderText = "ID";
			this.uxIDDataGridViewColumn.Name = "uxIDDataGridViewColumn";
			this.uxIDDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDataGridViewColumn.ReadOnly = true;		
			//
			// uxBrojRacunaDataGridViewColumn
			//
			this.uxBrojRacunaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxBrojRacunaDataGridViewColumn.DataPropertyName = "BrojRacuna";
			this.uxBrojRacunaDataGridViewColumn.HeaderText = "BrojRacuna";
			this.uxBrojRacunaDataGridViewColumn.Name = "uxBrojRacunaDataGridViewColumn";
			this.uxBrojRacunaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxBrojRacunaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxBrojRacunaDataGridViewColumn.ReadOnly = false;		
			//
			// uxModelZaIsplatuPlaceDataGridViewColumn
			//
			this.uxModelZaIsplatuPlaceDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxModelZaIsplatuPlaceDataGridViewColumn.DataPropertyName = "ModelZaIsplatuPlace";
			this.uxModelZaIsplatuPlaceDataGridViewColumn.HeaderText = "ModelZaIsplatuPlace";
			this.uxModelZaIsplatuPlaceDataGridViewColumn.Name = "uxModelZaIsplatuPlaceDataGridViewColumn";
			this.uxModelZaIsplatuPlaceDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxModelZaIsplatuPlaceDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxModelZaIsplatuPlaceDataGridViewColumn.ReadOnly = false;		
			//
			// uxPozivNaBrojZaIsplatuPlaceDataGridViewColumn
			//
			this.uxPozivNaBrojZaIsplatuPlaceDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxPozivNaBrojZaIsplatuPlaceDataGridViewColumn.DataPropertyName = "PozivNaBrojZaIsplatuPlace";
			this.uxPozivNaBrojZaIsplatuPlaceDataGridViewColumn.HeaderText = "PozivNaBrojZaIsplatuPlace";
			this.uxPozivNaBrojZaIsplatuPlaceDataGridViewColumn.Name = "uxPozivNaBrojZaIsplatuPlaceDataGridViewColumn";
			this.uxPozivNaBrojZaIsplatuPlaceDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxPozivNaBrojZaIsplatuPlaceDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxPozivNaBrojZaIsplatuPlaceDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDOsobaDataGridViewColumn
			//
			this.uxIDOsobaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDOsobaDataGridViewColumn.DataPropertyName = "IDOsoba";
			this.uxIDOsobaDataGridViewColumn.HeaderText = "IDOsoba";
			this.uxIDOsobaDataGridViewColumn.Name = "uxIDOsobaDataGridViewColumn";
			this.uxIDOsobaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDOsobaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDOsobaDataGridViewColumn.ReadOnly = false;		
			//
			// uxDatumOdDataGridViewColumn
			//
			this.uxDatumOdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDatumOdDataGridViewColumn.DataPropertyName = "DatumOd";
			this.uxDatumOdDataGridViewColumn.HeaderText = "DatumOd";
			this.uxDatumOdDataGridViewColumn.Name = "uxDatumOdDataGridViewColumn";
			this.uxDatumOdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDatumOdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDatumOdDataGridViewColumn.ReadOnly = false;		
			//
			// uxDatumDoDataGridViewColumn
			//
			this.uxDatumDoDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDatumDoDataGridViewColumn.DataPropertyName = "DatumDo";
			this.uxDatumDoDataGridViewColumn.HeaderText = "DatumDo";
			this.uxDatumDoDataGridViewColumn.Name = "uxDatumDoDataGridViewColumn";
			this.uxDatumDoDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDatumDoDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDatumDoDataGridViewColumn.ReadOnly = false;		
			//
			// uxPrimateljNazivDataGridViewColumn
			//
			this.uxPrimateljNazivDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxPrimateljNazivDataGridViewColumn.DataPropertyName = "PrimateljNaziv";
			this.uxPrimateljNazivDataGridViewColumn.HeaderText = "PrimateljNaziv";
			this.uxPrimateljNazivDataGridViewColumn.Name = "uxPrimateljNazivDataGridViewColumn";
			this.uxPrimateljNazivDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxPrimateljNazivDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxPrimateljNazivDataGridViewColumn.ReadOnly = false;		
			//
			// uxPrimateljSjedisteDataGridViewColumn
			//
			this.uxPrimateljSjedisteDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxPrimateljSjedisteDataGridViewColumn.DataPropertyName = "PrimateljSjediste";
			this.uxPrimateljSjedisteDataGridViewColumn.HeaderText = "PrimateljSjediste";
			this.uxPrimateljSjedisteDataGridViewColumn.Name = "uxPrimateljSjedisteDataGridViewColumn";
			this.uxPrimateljSjedisteDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxPrimateljSjedisteDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxPrimateljSjedisteDataGridViewColumn.ReadOnly = false;		
			//
			// uxBrojRacuna2DataGridViewColumn
			//
			this.uxBrojRacuna2DataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxBrojRacuna2DataGridViewColumn.DataPropertyName = "BrojRacuna2";
			this.uxBrojRacuna2DataGridViewColumn.HeaderText = "BrojRacuna2";
			this.uxBrojRacuna2DataGridViewColumn.Name = "uxBrojRacuna2DataGridViewColumn";
			this.uxBrojRacuna2DataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxBrojRacuna2DataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxBrojRacuna2DataGridViewColumn.ReadOnly = false;		
			//
			// uxIDOsobaDataGridViewColumn
			//				
			this.uxIDOsobaDataGridViewColumn.DisplayMember = "Ime";	
			this.uxIDOsobaDataGridViewColumn.ValueMember = "ID";	
			this.uxIDOsobaDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDOsobaDataGridViewColumn.DataSource = uxIDOsobaBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxOsobaBankovniRacunDataGridView);
			this.Name = "OsobaBankovniRacunDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDOsobaBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaBankovniRacunErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaBankovniRacunDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaBankovniRacunBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				OsobaBankovniRacunDataGridViewEventArgs args = new OsobaBankovniRacunDataGridViewEventArgs();
				args.OsobaBankovniRacun = _currentOsobaBankovniRacun;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class OsobaBankovniRacunDataGridViewEventArgs : System.EventArgs
		{
			private Entities.OsobaBankovniRacun	_OsobaBankovniRacun;
	
			/// <summary>
			/// the  Entities.OsobaBankovniRacun instance.
			/// </summary>
			public Entities.OsobaBankovniRacun OsobaBankovniRacun
			{
				get { return _OsobaBankovniRacun; }
				set { _OsobaBankovniRacun = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxOsobaBankovniRacunDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnOsobaBankovniRacunDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxOsobaBankovniRacunDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnOsobaBankovniRacunDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxOsobaBankovniRacunDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						e.Value = OsobaBankovniRacunList[e.RowIndex].ID;
						break;
					case "uxBrojRacunaDataGridViewColumn":
						e.Value = OsobaBankovniRacunList[e.RowIndex].BrojRacuna;
						break;
					case "uxModelZaIsplatuPlaceDataGridViewColumn":
						e.Value = OsobaBankovniRacunList[e.RowIndex].ModelZaIsplatuPlace;
						break;
					case "uxPozivNaBrojZaIsplatuPlaceDataGridViewColumn":
						e.Value = OsobaBankovniRacunList[e.RowIndex].PozivNaBrojZaIsplatuPlace;
						break;
					case "uxIDOsobaDataGridViewColumn":
						e.Value = OsobaBankovniRacunList[e.RowIndex].IDOsoba;
						break;
					case "uxDatumOdDataGridViewColumn":
						e.Value = OsobaBankovniRacunList[e.RowIndex].DatumOd;
						break;
					case "uxDatumDoDataGridViewColumn":
						e.Value = OsobaBankovniRacunList[e.RowIndex].DatumDo;
						break;
					case "uxPrimateljNazivDataGridViewColumn":
						e.Value = OsobaBankovniRacunList[e.RowIndex].PrimateljNaziv;
						break;
					case "uxPrimateljSjedisteDataGridViewColumn":
						e.Value = OsobaBankovniRacunList[e.RowIndex].PrimateljSjediste;
						break;
					case "uxBrojRacuna2DataGridViewColumn":
						e.Value = OsobaBankovniRacunList[e.RowIndex].BrojRacuna2;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxOsobaBankovniRacunDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnOsobaBankovniRacunDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxOsobaBankovniRacunDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						OsobaBankovniRacunList[e.RowIndex].ID = (System.Int32)e.Value;
						break;
					case "uxBrojRacunaDataGridViewColumn":
						OsobaBankovniRacunList[e.RowIndex].BrojRacuna = (System.String)e.Value;
						break;
					case "uxModelZaIsplatuPlaceDataGridViewColumn":
						OsobaBankovniRacunList[e.RowIndex].ModelZaIsplatuPlace = (System.String)e.Value;
						break;
					case "uxPozivNaBrojZaIsplatuPlaceDataGridViewColumn":
						OsobaBankovniRacunList[e.RowIndex].PozivNaBrojZaIsplatuPlace = (System.String)e.Value;
						break;
					case "uxIDOsobaDataGridViewColumn":
						OsobaBankovniRacunList[e.RowIndex].IDOsoba = (System.Int32)e.Value;
						break;
					case "uxDatumOdDataGridViewColumn":
						OsobaBankovniRacunList[e.RowIndex].DatumOd = (System.DateTime?)e.Value;
						break;
					case "uxDatumDoDataGridViewColumn":
						OsobaBankovniRacunList[e.RowIndex].DatumDo = (System.DateTime?)e.Value;
						break;
					case "uxPrimateljNazivDataGridViewColumn":
						OsobaBankovniRacunList[e.RowIndex].PrimateljNaziv = (System.String)e.Value;
						break;
					case "uxPrimateljSjedisteDataGridViewColumn":
						OsobaBankovniRacunList[e.RowIndex].PrimateljSjediste = (System.String)e.Value;
						break;
					case "uxBrojRacuna2DataGridViewColumn":
						OsobaBankovniRacunList[e.RowIndex].BrojRacuna2 = (System.String)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
